__author__ = 'Soul'

from DbOperator import *

class AndroidAppDbOperator(DbOperator):
    def __del__(self):
        self.close()

    def insert_record(self, record):
        sql = "insert into apps_t(app_name, app_down_count, app_pbl_date, app_pbl_ent, app_size, app_star, app_desc, app_src, app_fetch_dt) " \
              "values('%s','%s','%s','%s','%s','%s','%s','%s',%d)"
        insert_sql = sql % (record['app_name'],
                            record['app_down_count'],
                            record['app_pbl_date'],
                            record['app_pbl_ent'],
                            record['app_size'],
                            record['app_star'],
                            record['app_desc'],
                            record['app_src'],
                            record['app_fetch_dt']
                    )
        self.__do_insert__(insert_sql)